<template>
	<view style="">


		<view class="all_project_head_btn" style="">
			<project-button :projectId="project_id" stageName="过控负责人审核"></project-button>
			<step-button v-if="topBarActive === '1' && addFormData1.approval_log != null"
				:approvalLog="addFormData1.approval_log"></step-button>
			<step-button v-if="topBarActive === '2' && addFormData2.approval_log != null"
				:approvalLog="addFormData2.approval_log"></step-button>
			<step-button v-if="topBarActive === '3' && addFormData3.approval_log != null"
				:approvalLog="addFormData3.approval_log" :processList="stepProcessList3">
			</step-button>
			<step-button v-if="topBarActive === '4' && addFormData4.approval_log != (null || '')"
				:approvalLog="addFormData4.approval_log" :processList="stepProcessList4">
			</step-button>
		</view>

		<!-- 表切换 -->
		<view class="form_change">
			<view class="change2" :class="topBarActive === '3' ? 'topBarActiveBlue' : ''"
				@click="handleTopBarClick('3')">
				过程控制负责人审核表
			</view>
			<view class="change2" :class="topBarActive === '4' ? 'topBarActiveBlue' : ''"
				@click="handleTopBarClick('4')">
				过程控制负责人修改回复表
			</view>
		</view>
		<!-- 1技术负责人审核表 -->
		<view style="padding-bottom: 200rpx;" v-if="topBarActive === '1'">
			<!-- 项目名称 -->
			<view class="info_item">
				<text class="all_text_title">项目名称</text>
				<input placeholder="请输入项目名称" style="margin-top: 39rpx;" placeholder-style="font-size:30rpx" disabled
					:value="S_project_name" />
			</view>
			<!-- 项目审核内容 -->
			<view class="info_item" style="border-bottom: 0;">
				<text class="all_text_title">项目审核内容</text>
				<view class="line"
					style="background: #F7F7F7;margin-top: 34rpx;color: #333333;border-top: 1rpx solid  #EBEBEB;">
					<view class="line_item" style="width: 63rpx;">序号</view>
					<view class="line_item" style="width: 456rpx;">内容</view>
					<view class="line_item" style="width: 169rpx;">审核意见</view>
				</view>
				<view class="line" v-for="(item,index) in info_list">
					<view class="line_item" style="width: 63rpx;">{{ item.id }}</view>
					<view class="line_item" style="width: 456rpx;">{{ item.content }}</view>
					<view class="line_item" style="width: 169rpx;">
						<radio-group style="display: flex;justify-content: flex-start; flex-wrap: wrap;"
							@change="handleLotChange($event, index)">
							<label>
								<radio :disabled="!isSubmit" value="0" :checked="item.radio == '0' ? true : false"
									style="transform: scale(0.6);" />
								<text>是</text>
							</label>
							<label>
								<radio :disabled="!isSubmit" value="1" :checked="item.radio == '1' ? true : false"
									style="transform: scale(0.6);" />
								<text>否</text>
							</label>
							<label>
								<radio :disabled="!isSubmit" value="2" :checked="item.radio == '2' ? true : false"
									style="transform: scale(0.6);" />
								<text>其他</text>
							</label>
							<input :disabled="!isSubmit || item.radio == '2' ? false : true"
								style="border-bottom: 1px solid #aaa;width: 80%;margin-left: 10rpx;margin-bottom: 20rpx;"
								placeholder-style="font-size:30rpx" v-model="item.remark" />
						</radio-group>
					</view>
				</view>
			</view>
			<!-- 技术负责人审查意见-->
			<view class="info_item" style="border-bottom: 0;">
				<text class="all_text_title">技术负责人审查意见</text>
				<textarea :disabled="!isSubmit" v-model="addFormData1.review_comments" class="textera" maxlength="-1"
					auto-height="true" />
			</view>
			<!-- 附件上传提示 -->
			<view class="info_item" style="border-bottom: 0; color: #40A0F2;font-size: 26rpx;" @click="getMuBan()">
				<text style="color: #FF5A5F;">*请上传</text>
				<text style="color: #40A0F2;">过控负责人审核表</text>
			</view>
			<!-- 附件上传 -->
			<view class="info_item" style="border: 0;">
				<upload-file :isSubmit="isSubmit" :imgList="addFormData1.annex" :detailsImgList="detailsImgList"
					@my-upload-change="upLoadChange"></upload-file>
			</view>
			<!-- 审批备注 -->
			<view class="info_item" v-if="addFormData1.is_approve == 1 && details_project_status == '321'"
				style="border-bottom: 0;">
				<text class="all_text_title">审批备注</text>
				<textarea v-model="approval_remark" class="textera" maxlength="-1" auto-height="true" />
			</view>
		</view>
		<!-- 1底部按钮 -->
		<view class="bottom" v-if="topBarActive === '1'">
			<view v-if="addFormData1.is_edit != '1'">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" @click="handleSubmit1('1')"
					form-type="reset">
					保存草稿
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleSubmit1('0')">
					提交
				</button>
			</view>
			<view v-if="addFormData1.is_approve == 1 && details_project_status == '321'">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleExamine1('-1')">
					驳回
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleExamine1('1')">
					审批通过
				</button>
			</view>
		</view>

		<!-- 2技术负责人审核修改回复表 -->
		<view style="padding-bottom: 200rpx;" v-if="topBarActive === '2'">
			<!-- 项目名称 -->
			<view class="info_item">
				<text class="all_text_title">项目名称</text>
				<input placeholder="请输入项目名称" style="margin-top: 39rpx;" placeholder-style="font-size:30rpx" disabled
					:value="S_project_name2" />
			</view>
			<!-- 修改记录 -->
			<view class="info_item" style="border-bottom: 0;">
				<text class="all_text_title">修改记录</text>
				<textarea v-model="addFormData2.modification_record" :disabled="!isSubmit2" class="textera"
					maxlength="-1" auto-height="true" />
			</view>
			<!-- 日期 -->
			<view class="riqi" style="margin-top: 30rpx;">
				<text>日期</text>
				<picker :disabled="!isSubmit2" mode="date" @change="setDate">
					<view class="rq">
						<text>{{ date }}</text>
						<image src="../../../../static/project/date.png" class="date"></image>
					</view>
				</picker>
			</view>
			<!-- 附件上传 -->
			<view class="info_item" style="border: 0;">
				<upload-file :isSubmit="isSubmit2" :imgList="addFormData2.confirm_annex"
					:detailsImgList="detailsImgList2" @my-upload-change="upLoadChange2"></upload-file>
			</view>
			<!-- 审批备注 -->
			<view class="info_item" v-if="addFormData2.is_approve == 1 && details_project_status == '322'"
				style="border-bottom: 0;">
				<text class="all_text_title">审批备注</text>
				<textarea v-model="approval_remark2" class="textera" maxlength="-1" auto-height="true" />
			</view>
		</view>
		<!-- 2底部按钮 -->
		<view class="bottom" v-if="topBarActive === '2'">
			<view v-if="addFormData2.is_edit != '1'">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleSubmit2('1')">
					保存草稿
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleSubmit2('0')">
					提交
				</button>
			</view>
			<view v-if="addFormData2.is_approve == 1 && details_project_status == '322'">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleExamine2('-1')">
					驳回
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleExamine2('1')">
					审批通过
				</button>
			</view>
		</view>

		<!-- 3过程控制负责人审核表 -->
		<view style="padding-bottom: 200rpx;" v-if="topBarActive === '3'">
			<!-- 项目名称 -->
			<view class="info_item">
				<text class="all_text_title">项目名称</text>
				<input placeholder="请输入项目名称" style="margin-top: 39rpx;" placeholder-style="font-size:30rpx" disabled
					:value="S_project_name3" />
			</view>
			<!-- 审核意见 -->
			<view class="info_item" style="border-bottom: 0;">
				<text class="all_text_title">审核意见</text>
				<view class="line"
					style="background: #F7F7F7;margin-top: 34rpx;color: #333333;border-top: 1rpx solid  #EBEBEB;">
					<view class="line_item" style="width: 63rpx;">序号</view>
					<view class="line_item" style="width: 456rpx;">内容</view>
					<view class="line_item" style="width: 169rpx;">审核意见</view>
				</view>
				<view class="line" v-for="(item,index) in shenhe_yijain">
					<view class="line_item" style="width: 63rpx;">{{ item.id }}</view>
					<view class="line_item" style="width: 456rpx;">{{ item.content}}</view>
					<view class="line_item" style="width: 169rpx;">
						<radio-group @change="handleLotChange2($event, index)">
							<label>
								<radio :disabled="!isSubmit3" value="0" :checked="item.radio == '0' ? true : false"
									style="transform: scale(0.6);" />
								<text>有</text>
							</label>
							<label>
								<radio :disabled="!isSubmit3" value="1" :checked="item.radio == '1' ? true : false"
									style="transform: scale(0.6);" />
								<text>无</text>
							</label>
						</radio-group>
					</view>
				</view>
			</view>
			<!-- 意见及建议-->
			<view class="info_item" style="border-bottom: 0;">
				<text class="all_text_title">意见及建议</text>
				<textarea v-model="addFormData3.suggestions =='null'? '':addFormData3.suggestions "
					:disabled="!isSubmit3" class="textera" maxlength="-1" auto-height="true" />
			</view>
			<!-- 附件上传 -->
			<view class="info_item" style="border: 0;">
				<upload-file :isSubmit="isSubmit3" :imgList="addFormData3.thr_annex" :detailsImgList="detailsImgList3"
					@my-upload-change="upLoadChange3"></upload-file>
			</view>
			<!-- 审批备注 -->
			<view class="info_item" v-if="addFormData3.is_approve == 1 && details_project_status == '323'"
				style="border-bottom: 0;">
				<text class="all_text_title">审批备注</text>
				<textarea v-model="approval_remark3" class="textera" maxlength="-1" auto-height="true" />
			</view>
		</view>
		<!-- 3底部按钮 -->
		<view class="bottom" v-if="topBarActive === '3'">
			<view v-if="addFormData3.is_edit != '1'">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleSubmit3('1')">
					保存草稿
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleSubmit3('0')">
					提交
				</button>
			</view>

			<!-- 可撤回时显示 -->
			<view class="bottom"
				v-if="addFormData3.is_edit == 1 && addFormData3.withdraw_status == 1 && addFormData3.is_approve != 1">
				<button class="bottom_btn" @click="handleWithdraw()" style="background: #DD524D; width: 100%;"
					form-type="reset">
					撤回
				</button>
			</view>

			<view
				v-if="addFormData3.is_approve == 1 && details_project_status == '323' && addFormData3.withdraw_status == 1">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleExamine3('-1')">
					驳回
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleExamine3('1')">
					审批通过
				</button>
			</view>

			<!-- 可撤回时显示 -->
			<view class="bottom2" v-if="addFormData3.is_approve == 1 && addFormData3.withdraw_status == 1">
				<button class="bottom_btn2" @click="handleWithdraw()" style="background: #FF5A5F; margin-left: 0;"
					form-type="reset">
					撤回
				</button>
				<button class="bottom_btn2" @click="handleExamine3('-1')" style="background: #CCCCCC;margin-left: 33%;"
					form-type="reset">
					驳回
				</button>
				<button class="bottom_btn2"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF);margin-left: 66%;"
					@click="handleExamine3('1')" form-type="submit">
					审批通过
				</button>
			</view>

		</view>

		<!-- 4过程控制负责人修改回复表 -->
		<view style="padding-bottom: 200rpx;" v-if="topBarActive === '4'">
			<!-- 项目名称 -->
			<view class="info_item">
				<text class="all_text_title">项目名称</text>
				<input placeholder="请输入项目名称" style="margin-top: 39rpx;" placeholder-style="font-size:30rpx"
					:value="S_project_name4" disabled />
			</view>
			<!-- 修改记录 -->
			<view class="info_item" style="border-bottom: 0;">
				<text class="all_text_title">修改记录</text>
				<textarea
					v-model="addFormData4.four_modification_record == 'null' ? '':addFormData4.four_modification_record"
					:disabled="!isSubmit4" class="textera" maxlength="-1" auto-height="true" />
			</view>
			<!-- 日期 -->
			<view class="riqi" style="margin-top: 30rpx;">
				<text>日期</text>
				<picker :disabled="!isSubmit4" mode="date" @change="setDate2">
					<view class="rq">
						<text>{{ date2 == 'null'?(addFormData4.is_approve == 1?'未选择时间':'请选择时间'):date2 }}</text>
						<image src="../../../../static/project/date.png" class="date"></image>
					</view>
				</picker>
			</view>
			<!-- 附件上传 -->
			<view class="info_item" style="border: 0;">
				<upload-file :isSubmit="isSubmit4" :imgList="addFormData4.four_annex" :detailsImgList="detailsImgList4"
					@my-upload-change="upLoadChange4"></upload-file>
			</view>
			<!-- 审批备注 -->
			<view class="info_item" v-if="addFormData4.is_approve == 1 && details_project_status == '324'"
				style="border-bottom: 0;">
				<text class="all_text_title">审批备注</text>
				<textarea v-model="approval_remark4" class="textera" maxlength="-1" auto-height="true" />
			</view>
		</view>
		<view style="width: 100%;height: 200rpx;"></view>
		<!-- 4底部按钮 -->
		<view class="bottom" v-if="topBarActive === '4'">
			<view v-if="addFormData4.is_edit != '1'">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleSubmit4('1')">
					保存草稿
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleSubmit4('0')">
					提交
				</button>
			</view>

			<!-- 可撤回时显示 -->
			<view class="bottom"
				v-if="addFormData4.is_edit == 1 && addFormData4.withdraw_status == 1 && addFormData4.is_approve != 1">
				<button class="bottom_btn" @click="handleWithdraw()" style="background: #DD524D; width: 100%;"
					form-type="reset">
					撤回
				</button>
			</view>

			<view
				v-if="addFormData4.is_approve == 1 && details_project_status == '324' && addFormData4.withdraw_status != 1">
				<button class="bottom_btn" style="background: #CCCCCC; width: 380rpx;" form-type="reset"
					@click="handleExamine4('-1')">
					驳回
				</button>
				<button class="bottom_btn"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF); margin-top: -88rpx;margin-left: 50%;"
					form-type="submit" @click="handleExamine4('1')">
					审批通过
				</button>
			</view>

			<!-- 可撤回时显示 -->
			<view class="bottom2" v-if="addFormData4.is_approve == 1 && addFormData4.withdraw_status == 1">
				<button class="bottom_btn2" @click="handleWithdraw()" style="background: #FF5A5F; margin-left: 0;"
					form-type="reset">
					撤回
				</button>
				<button class="bottom_btn2" @click="handleExamine4('-1')" style="background: #CCCCCC;margin-left: 33%;"
					form-type="reset">
					驳回
				</button>
				<button class="bottom_btn2"
					style="background: linear-gradient(0deg, #037CE3, #2EB3FF);margin-left: 66%;"
					@click="handleExamine4('1')" form-type="submit">
					审批通过
				</button>
			</view>


		</view>
	</view>
</template>

<script>
	import xiaolu from '@/components/xiaolu-signature/index.vue';
	import UploadFile from '@/components/upload-file.vue';
	import ProjectButton from '@/components/project-button.vue';
	import StepButton from '@/components/step-button.vue';
	export default {
		components: {
			UploadFile,
			ProjectButton,
			StepButton,
			xiaolu
		},
		data() {
			return {
				stepProcessList3: {
					stage_code: '',
					project_id: ''
				},
				stepProcessList4: {
					stage_code: '',
					project_id: ''
				},
				is_show: 1, //控制表切换显示
				class1: 'change1', //控制切换按钮样式
				class2: 'change2',
				class3: 'change2',
				class4: 'change2',
				s1: '', //签名图片地址
				s2: '',
				s3: '',
				s4: '',
				s5: '',
				s6: '',
				date: '选择时间',
				date2: '选择时间',
				list: [1, 1],

				shenhe_yijain: [{
						id: 1,
						content: '审核意见',
						radio: '0'
					},
					{
						id: 2,
						content: '企业情况调查表',
						radio: '0'
					},
					{
						id: 3,
						content: '企业安全评价委托书',
						radio: '0'
					},
					{
						id: 4,
						content: '项目风险分析记录',
						radio: '0'
					},
					{
						id: 5,
						content: '项目成员任命书',
						radio: '0'
					},
					{
						id: 6,
						content: '项目计划书',
						radio: '0'
					},
					{
						id: 7,
						content: '委托方提供资料清单',
						radio: '0'
					},
					{
						id: 8,
						content: '相关类比资料（针对预评价项目）',
						radio: '0'
					},
					{
						id: 9,
						content: '现场影像记录',
						radio: '0'
					},
					{
						id: 10,
						content: '现场勘察、意见记录表',
						radio: '0'
					},
					{
						id: 11,
						content: '项目整改通知单',
						radio: '0'
					},
					{
						id: 12,
						content: '整改报告 （由企业提供）',
						radio: '0'
					},
					{
						id: 13,
						content: '项目整改复查记录表',
						radio: '0'
					},
					{
						id: 14,
						content: '报告内部审核记录',
						radio: '0'
					},
					{
						id: 15,
						content: '技术负责人审核记录',
						radio: '0'
					},
					{
						id: 16,
						content: '过程控制负责人审核记录',
						radio: '0'
					},
					{
						id: 17,
						content: '安全评价报告三审稿（纸质、电子版）',
						radio: '0'
					},
					{
						id: 18,
						content: '专家评审意见',
						radio: '0'
					},
					{
						id: 19,
						content: '安全评价报告附件',
						radio: '0'
					},
					{
						id: 20,
						content: '安全评价合同',
						radio: '0'
					},
					{
						id: 21,
						content: '客户意见反馈表',
						radio: '0'
					}
				],

				info_list: [{
						id: 1,
						info: '现场收集的有关资料是否齐全',
						value: '0',
						remark: ''
					},
					{
						id: 2,
						info: '现场收集的有关资料是否有效',
						value: '0',
						remark: ''
					},
					{
						id: 3,
						info: '危险有害因素识别是否充分',
						value: '0',
						remark: ''
					},
					{
						id: 4,
						info: '评价方法是否合理',
						value: '0',
						remark: ''
					},
					{
						id: 5,
						info: '对策措施是否有针对性',
						value: '0',
						remark: ''
					},
					{
						id: 6,
						info: '结论是否正确',
						value: '0',
						remark: ''
					},
					{
						id: 7,
						info: '格式是否符合要求',
						value: '0',
						remark: ''
					},
					{
						id: 8,
						info: '文字是否准确',
						value: '0',
						remark: ''
					}
				],
				project_id: '',
				addFormData1: {
					// json附件
					annex: '',
					// 项目审核内容
					audit_content: '',
					// 文件格式审查意见
					document_format: '',
					// 	项目内容审查意见
					review_comments: '',
					// 审核负责人签字
					sign_audit: ''
				},
				addFormData2: {
					// json附件
					confirm_annex: '',
					// 修改记录
					modification_record: '',
					// 修改人确认
					// sign_modifier: '',
					// 审核负责人确认
					// confirm_sign_audit: '',
					// 日期
					confirm_date: ''
				},
				addFormData3: {
					// json附件
					thr_annex: '',
					// 审核意见json
					audit_opinion: '',
					// 出版情况
					publication: '',
					// 意见及建议
					suggestions: '',
					// 过程控制负责人签字
					sign_control: ''
				},
				addFormData4: {
					// json附件
					four_annex: '',
					// 修改记录
					four_modification_record: '',
					// 修改人确认
					four_sign_modifier: '',
					// 技术负责人确认
					four_confirm_sign_audit: '',
					// 日期
					four_confirm_date: ''
				},
				S_project_name: '',
				S_project_name2: '',
				S_project_name3: '',
				S_project_name4: '',
				isSubmit: true,
				isSubmit2: true,
				isSubmit3: true,
				isSubmit4: true,
				detailsImgList: [],
				detailsImgList2: [],
				detailsImgList3: [],
				detailsImgList4: [],
				submitImgList: [],
				submitImgList2: [],
				submitImgList3: [],
				submitImgList4: [],
				approval_remark: '',
				approval_remark2: '',
				approval_remark3: '',
				approval_remark4: '',
				details_project_status: '',
				token: '',
				member_id: '',
				company_id: '',

				topBarActive: '3'
			};
		},
		async onLoad(options) {
			this.token = uni.getStorageSync('btlh_process_token') || '';
			this.member_id = uni.getStorageSync('btlh_process_member_id') || '';
			this.company_id = uni.getStorageSync('bthl_process_LoginCompanyId') || '';

			this.details_project_status = options.details_project_status || '';
			this.project_id = options.project_id || '';

			if (this.details_project_status) {
				if (this.details_project_status == '321') {
					this.topBarActive = '1'
				}
				if (this.details_project_status == '322') {
					this.topBarActive = '2'
				}
				if (this.details_project_status == '323') {
					this.topBarActive = '3'
				}
				if (this.details_project_status == '324') {
					this.topBarActive = '4'
				}
			}
			if (this.details_project_status && this.project_id) {
				if (this.details_project_status == '321') {
					this.getProjectDetails1();
				} else if (this.details_project_status == '322') {
					this.getProjectDetails2();
				} else if (this.details_project_status == '323') {
					this.getProjectDetails3();
				} else if (this.details_project_status == '324') {
					this.getProjectDetails4();
				} else {
					this.getProjectDetails3();
				}
			}
		},
		// 开启微信发送给朋友
		//#ifdef MP-WEIXIN
		onShareAppMessage() {
			return {
				title: this.addFormData.project_name,
				path: '/packageProject/pages/project/threeCheck/processPeople?project_id=' + this.project_id +
					'&details_project_status=' + this.details_project_status
			}
		},
		//#endif
		methods: {
			// 点击复制模板链接
			getMuBan() {
				uni.setClipboardData({
					data: 'http://control.sxpz.vip/Template/过控负责人审核表.doc',
					success: function() {
			  	uni.showToast({
							title: '复制成功'
						})
					}
				});
			},
			// 点击撤回
			async handleWithdraw() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/withdraw',
					method: 'GET',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,
						project_id: this.project_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.navigateBack({
					delta: 1
				})
			},
			// 审批4
			async handleExamine4(val) {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize4_approval',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id,
						approval_status: val,
						remark: this.approval_remark4
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 提交4
			async handleSubmit4(val) {
				if (this.date2 != '选择时间') {
					this.addFormData4.four_confirm_date = this.date2;
				}
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize4',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,
						project_id: this.project_id,

						is_draft: val,

						four_annex: JSON.stringify(this.submitImgList4),

						four_modification_record: this.addFormData4.four_modification_record,
						four_confirm_date: this.addFormData4.four_confirm_date
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 获取项目详情4
			async getProjectDetails4() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize4_detail',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});

				// 判断是否首次进入次流程
				if (res.datas.info.is_new != 1) {
					this.addFormData4 = res.datas.info;
				} else {
					this.addFormData4.is_edit = res.datas.info.is_edit
				}
				// 判断禁用
				if (this.addFormData4.is_draft != '1' && this.addFormData4.is_edit == '1') {
					this.isSubmit4 = false;
				}

				this.stepProcessList4.project_id = this.addFormData4.project_id;
				this.stepProcessList4.stage_code = this.addFormData4.project_status;
				// 禁用值
				this.S_project_name4 = res.datas.info.project_name;

				// 处理文件
				if (this.addFormData4.four_annex) {
					this.detailsImgList4 = this.addFormData4.four_annex;
					this.submitImgList4 = this.addFormData4.four_annex;
				}
				// 处理时间
				if (this.addFormData4.four_confirm_date) {
					this.date2 = this.addFormData4.four_confirm_date;
				}
				console.log('过控负责人审核222222222', this.addFormData4);
			},
			// 审批3
			async handleExamine3(val) {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize3_approval',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id,
						approval_status: val,
						remark: this.approval_remark3
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/pakcageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 编辑提交3
			async handleSubmit3(val) {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize3',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,
						project_id: this.project_id,

						is_draft: val,

						thr_annex: JSON.stringify(this.submitImgList3),

						audit_opinion: JSON.stringify(this.shenhe_yijain),
						suggestions: this.addFormData3.suggestions
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 获取详情3
			async getProjectDetails3() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize3_detail',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// 判断是否首次进入次流程
				if (res.datas.info.is_new != 1) {
					this.addFormData3 = res.datas.info;
				} else {
					this.addFormData3.is_edit = res.datas.info.is_edit
				}
				// 判断禁用
				if (this.addFormData3.is_draft != '1' && this.addFormData3.is_edit == '1') {
					this.isSubmit3 = false;
				}

				this.stepProcessList3.project_id = this.addFormData3.project_id;
				this.stepProcessList3.stage_code = this.addFormData3.project_status;
				// 禁用值
				this.S_project_name3 = res.datas.info.project_name;

				// 处理文件
				if (this.addFormData3.thr_annex) {
					this.detailsImgList3 = this.addFormData3.thr_annex;
					this.submitImgList3 = this.addFormData3.thr_annex;
				}
				// 处理表格
				if (this.addFormData3.audit_opinion) {
					this.shenhe_yijain = this.addFormData3.audit_opinion;
				}
				console.log('过控负责人11111111', this.addFormData3);
			},
			// 审批2
			async handleExamine2(val) {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize2_approval',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id,
						approval_status: val,
						remark: this.approval_remark2
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 提交2
			async handleSubmit2(val) {
				if (this.date != '选择时间') {
					this.addFormData2.confirm_date = this.date;
				}
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize2',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,
						project_id: this.project_id,

						is_draft: val,

						confirm_annex: JSON.stringify(this.submitImgList2),

						modification_record: this.addFormData2.modification_record,
						confirm_date: this.addFormData2.confirm_date
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 获取项目详情2
			async getProjectDetails2() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize2_detail',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});

				// 判断是否首次进入次流程
				if (res.datas.info.is_new != 1) {
					this.addFormData2 = res.datas.info;
				} else {
					this.addFormData2.is_edit = res.datas.info.is_edit
				}
				// 判断禁用
				if (this.addFormData2.is_draft != '1' && this.addFormData2.is_edit == '1') {
					this.isSubmit2 = false;
				}
				// 禁用值
				this.S_project_name2 = res.datas.info.project_name;

				// 处理文件
				if (this.addFormData2.confirm_annex) {
					this.detailsImgList2 = this.addFormData2.confirm_annex;
					this.submitImgList2 = this.addFormData2.confirm_annex;
				}
				// 处理时间
				if (this.addFormData2.confirm_date) {
					this.date = this.addFormData2.confirm_date;
				}
				console.log('技术负责人审核222222222', this.addFormData2);
			},
			// 审批1
			async handleExamine1(val) {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize1_approval',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id,
						approval_status: val,
						remark: this.approval_remark
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 编辑提交1
			async handleSubmit1(val) {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize1',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,
						project_id: this.project_id,

						is_draft: val,

						annex: JSON.stringify(this.submitImgList),

						review_comments: this.addFormData1.review_comments,
						audit_content: JSON.stringify(this.info_list)
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				uni.showToast({
					title: res.datas.msg,
					icon: 'none'
				});
				/* uni.navigateTo({
					url: `/packageProject/pages/project/projectManagement`
				}); */
				uni.navigateBack({
					delta: 1
				})
			},
			// 获取详情1
			async getProjectDetails1() {
				const {
					data: res
				} = await this.$myRequest({
					url: 'Project/authorize1_detail',
					method: 'POST',
					data: {
						member_id: this.member_id,
						token: this.token,
						company_id: this.company_id,

						project_id: this.project_id
					}
				});
				if (res.code != 200)
					return uni.showToast({
						title: res.datas.msg,
						icon: 'none'
					});
				// 判断是否首次进入次流程
				if (res.datas.info.is_new != 1) {
					this.addFormData1 = res.datas.info;
				} else {
					this.addFormData1.is_edit = res.datas.info.is_edit
				}
				// 判断禁用
				if (this.addFormData1.is_draft != '1' && this.addFormData1.is_edit == '1') {
					this.isSubmit = false;
				}
				// 禁用值
				this.S_project_name = res.datas.info.project_name;

				// 处理文件
				if (this.addFormData1.annex) {
					this.detailsImgList = this.addFormData1.annex;
					this.submitImgList = this.addFormData1.annex;
				}
				// 处理表格
				if (this.addFormData1.audit_content) {
					this.info_list = this.addFormData1.audit_content;
				}
				console.log('技术负责人11111111', this.addFormData1);
			},
			// 表格单选改变
			handleLotChange(e, index) {
				this.info_list[index].value = e.detail.value;
				if (e.detail.value != 2) {
					this.info_list[index].remark = '';
				}
				// console.log(index)
				// console.log(this.info_list)
			},
			handleLotChange2(e, index) {
				this.shenhe_yijain[index].radio = e.detail.value;
			},
			// 顶部导航点击tabs click
			handleTopBarClick(val) {
				if (this.details_project_status == '321') {
					return;
				} else if (this.details_project_status == '322' && (val == '3' || val == '4')) {
					return;
				} else if (this.details_project_status == '323' && val == '4') {
					return;
				}
				this.topBarActive = val;
				if (val == '1') {
					this.getProjectDetails1();
				}
				if (val == '2') {
					this.getProjectDetails2();
				}
				if (val == '3') {
					this.getProjectDetails3();
				}
				if (val == '4') {
					this.getProjectDetails4();
				}
			},

			// 文件上传
			upLoadChange(data) {
				console.log('文件列表', data);
				this.submitImgList = data;
			},
			upLoadChange2(data) {
				console.log('文件列表', data);
				this.submitImgList2 = data;
			},
			upLoadChange3(data) {
				console.log('文件列表', data);
				this.submitImgList3 = data;
			},
			upLoadChange4(data) {
				console.log('文件列表', data);
				this.submitImgList4 = data;
			},
			// 设置时间
			setDate(e) {
				this.date = e.detail.value;
			},
			setDate2(e) {
				this.date2 = e.detail.value;
			},
			// 点击右下文件按钮
			fbtnClick() {
				console.log('22');
			},
			/*
				点击返回
				 */
			back() {
				// uni.navigateBack({
				// 	delta: 1
				// });
				uni.redirectTo({
					url: '/packageProject/pages/project/projectManagement'
				})
			}
		}
	};
</script>

<style lang="scss">
	.bottom2 {
		width: 100%;
	}

	.bottom_btn2 {
		width: 34%;
		height: 88rpx;
		border-radius: 0;
		position: fixed;
		bottom: 0;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #ffffff;
		z-index: 999;
	}



	.line {
		display: flex;
		flex-direction: row;
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 500;
		line-height: 52rpx;
		border-right: 1rpx solid #ebebeb;

		.line_item {
			height: auto;
			color: #666666;
			// border: 1rpx solid #EBEBEB;
			border-bottom: 1rpx solid #ebebeb;
			border-left: 1rpx solid #ebebeb;
			text-align: center;
			display: flex;
			align-items: center;
		}
	}

	.form_change {
		width: 100%;
		height: auto;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		font-size: 26rpx;

		.topBarActiveBlue {
			color: #ffffff !important;
			background: #40a0f2 !important;
		}

		.change2 {
			width: 50%;
			height: 88rpx;
			line-height: 85rpx;
			text-align: center;
			font-family: PingFang SC;
			font-weight: 500;
			color: #999999;
			background: #e7f1fa;
		}
	}

	.riqi {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-left: 310rpx;

		.rq {
			width: auto;
			height: 60rpx;
			border: 1rpx solid #dfdfdf;
			border-radius: 10rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-left: 50rpx;
			padding-left: 21rpx;
		}
	}

	.picker1 {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
		margin-top: 42rpx;
	}

	.textera {
		width: 690rpx;
		height: 225rpx;
		background: #f7f7f7;
		margin-top: 30rpx;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}

	.date {
		width: 32rpx;
		height: 32rpx;
		margin-left: 60rpx;
	}

	.text2 {
		font-size: 25rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #333333;
		margin-top: 40rpx;
		margin-left: 310rpx;
		display: flex;
		flex-direction: row;
	}

	.text1 {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #128bf1;
		margin-top: 21rpx;
	}

	.fbtn {
		position: fixed;
		left: 592rpx;
		bottom: 120rpx;
		z-index: 5;

		image {
			width: 134rpx;
			height: 134rpx;
		}
	}

	.file_name {
		font-size: 26rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
		margin-left: 19rpx;
	}

	.uptext {
		font-size: 20rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #128bf1;
		margin-left: 10rpx;
	}

	.bottom {
		width: 100%;
		z-index: 999;
		position: fixed;
		bottom: 0;
	}

	.bottom_btn {
		width: 375rpx;
		height: 88rpx;
		margin-left: 0;
		border-radius: 0;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #ffffff;
	}

	.info_item {
		width: 690rpx;
		height: auto;
		border-bottom: 1rpx solid #e3e3e3;
		margin-left: 30rpx;
		margin-top: 44rpx;
	}

	.head_text {
		width: 100%;
		height: 128rpx;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		line-height: 160rpx;
		text-align: center;
	}
</style>
